package com.nm.service.convert;

import com.nm.orm.pojo.LabelEntity;
import com.nm.service.output.LabelIsUseOutput;
import org.assertj.core.util.Collections;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/3/7 0007.
 */
public class LabelSvcConvert {

    public static List<LabelIsUseOutput> conv(List<LabelEntity> labels){
        List<LabelIsUseOutput> out = new ArrayList<LabelIsUseOutput>();
        if (Collections.isNullOrEmpty(labels)){
            return null;
        }

        LabelIsUseOutput labelOut = null;
        for (LabelEntity label:labels){
            labelOut = new LabelIsUseOutput();
            labelOut.setId(label.getId());
            labelOut.setName(label.getName());
            out.add(labelOut);
        }
        return out;
    }
}
